#/bin/bash
function blue_echo()
{
    echo -e "\033[36m shell info--> $1 \033[0m"
}

function red_echo()
{
    echo -e "\033[31m shell info--> $1 \033[0m"
}

function doStartAll()
{
    echo "cn.mystyle.portal-1.0.0.jar, starting..."
    `nohup java -jar ./portal/cn.mystyle.portal-1.0.0.jar &`
	
	echo "cn.mystyle.user.server-1.0.0.jar, starting..."
    `nohup java -jar ./userservice/cn.mystyle.user.server-1.0.0.jar &`
	
	echo "cn.mystyle.account.server-1.0.0.jar, starting..."
    `nohup java -jar ./accountservice/cn.mystyle.account.server-1.0.0.jar &`
	
	echo "start success,bye..."
}

function doStartPortal()
{
    echo "cn.mystyle.portal-1.0.0.jar, starting..."
    `nohup java -jar ./portal/cn.mystyle.portal-1.0.0.jar &`
	
	echo "start success,bye..."
}

function doStartUS()
{
    echo "cn.mystyle.user.server-1.0.0.jar, starting..."
    `nohup java -jar ./userservice/cn.mystyle.user.server-1.0.0.jar &`
	
	echo "start success,bye..."
}

function doStartAS()
{
	echo "cn.mystyle.account.server-1.0.0.jar, starting..."
    `nohup java -jar ./accountservice/cn.mystyle.account.server-1.0.0.jar &`
	
	echo "start success,bye..."
}

if [[ $1 == all ]];then
    doStartAll
elif [[ $1 == portal ]];then
    doStartPortal
elif [[ $1 == userservice ]];then
    doStartUS
elif [[ $1 == accountservice ]];then
    doStartAS
else
    red_echo "请输入参数: all(启动所有服务) | portal(启动门户服务) | userservice(启动用户服务) | accountservice(启动账目服务)"
fi
